フィルターのクリア

How to include a punctuation in a string?

6 ビュー (過去 30 日間)
Kratos
Kratos 2015 年 2 月 27 日
編集済み: Stephen23 2015 年 2 月 27 日
Hello I have a text file which has
1-34-4-2
2-20-3-5
2-13-10-6
1-7-1-13
2-28-6-1
2-40-12-3
2-54-2-3
1-21-3-6
:
1-12-1-3
1-35-2-4
2-65-11-1
2-69-5-2
1-58-12-9
2-1-11-4
0-0-0-0
I am suppose to use this number to extract a word from another text file. Everything works fine until I get to line with the punctuation marks. How do I make sure that I don't get an error when I get there and include it in my string. The line after punctuation mark is a space that you have to include in the string. How do I write a code that takes in both the space and the punctuation mark?
  1 件のコメント
Stephen23
Stephen23 2015 年 2 月 27 日
編集済み: Stephen23 2015 年 2 月 27 日
What exactly are you doing?
You do not tell us if you are reading this file into MATLAB, and if so with what functions, or if you are writing it by appending text to a file, or doing some other text-parsing operations... are we supposed to guess what you are doing and how you are doing it? Without seeing your code, how do we know what you have tried, and what could be changed to make it work?
You write that "Everything works fine"... but nowhere do you tell us exactly what that Everything is.
Please help us by reading this:

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeLanguage Support についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by