필터 지우기
필터 지우기

How to replace new line with white space in text documents

조회 수: 24 (최근 30일)
Fateme Jalali
Fateme Jalali 2016년 1월 31일
댓글: Andrew Mohan 2018년 1월 17일
Hello,I am trying to change all new lines in my database with white space,but codes does not work.can any one help me please.Data base is attached.
test1 = fileread('part1.txt');
newTest = sprintf(strrep(test1, '\n', ' '))

채택된 답변

Stephen23
Stephen23 2016년 1월 31일
편집: Stephen23 2016년 1월 31일
str = regexprep(test1,'\s+',' ');
or
str = regexprep(test1,'[\n\r]+',' ')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by