ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Save trailing empty cells in a tab delimited text file (https://www.excelbanter.com/excel-discussion-misc-queries/84668-save-trailing-empty-cells-tab-delimited-text-file.html)

osios

Save trailing empty cells in a tab delimited text file
 

Hi,

I have a tab delimited text file which contains some empty values in
some of the cells, and some of the lines have empty cells at the end of
the line. In my original file (outputted by some software) empty cells
at the end of the line are represnted by a number of '\t' characters
with empty strings in between.

When I open the file to edit it in excel and then resave it, empty
cells at the end of a line are not saved.

An example:
If this is the original line string (spaces are not part of the string
- they just seperate chracters here, for clarity):

1 \t 2 \t \t \t \n

Excel will save it as:

1 \t 2 \n


I need the file saved in the first format of the example rather then in
the second format outputted by excel in order to continue processing it
in other software. Any way to do it, if I know in advance how many
columns I need in each line?


--
osios
------------------------------------------------------------------------
osios's Profile: http://www.excelforum.com/member.php...o&userid=33756
View this thread: http://www.excelforum.com/showthread...hreadid=535308


Bryan Hessey

Save trailing empty cells in a tab delimited text file
 

Hi,

You could put $$4$$ in the next empty column, edit the output file in
Notepad and Replace All ,$$4$$ with nothing.

Hope this helps

--

osios Wrote:
Hi,

I have a tab delimited text file which contains some empty values in
some of the cells, and some of the lines have empty cells at the end of
the line. In my original file (outputted by some software) empty cells
at the end of the line are represnted by a number of '\t' characters
with empty strings in between.

When I open the file to edit it in excel and then resave it, empty
cells at the end of a line are not saved.

An example:
If this is the original line string (spaces are not part of the string
- they just seperate chracters here, for clarity):

1 \t 2 \t \t \t \n

Excel will save it as:

1 \t 2 \n


I need the file saved in the first format of the example rather then in
the second format outputted by excel in order to continue processing it
in other software. Any way to do it, if I know in advance how many
columns I need in each line?



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=535308


osios

Save trailing empty cells in a tab delimited text file
 

Thanks for the idea - I think it would work just fine.


--
osios
------------------------------------------------------------------------
osios's Profile: http://www.excelforum.com/member.php...o&userid=33756
View this thread: http://www.excelforum.com/showthread...hreadid=535308


Bryan Hessey

Save trailing empty cells in a tab delimited text file
 

Oh yes, it works, and thanks for the response

--

osios Wrote:
Thanks for the idea - I think it would work just fine.



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=535308



All times are GMT +1. The time now is 08:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com