Importing a .txt and exporting it again.

  • Thread starter Thread starter Ciar?n
  • Start date Start date
C

Ciar?n

I've got a .txt file that I need to sort before uploading into an
accounting system.

I open it with excel and all data is in Col A.
Then I seperate it out into it relevant fileds using data, text to
columns.
It isolates the data I need to sort by perfectly. Then i sort it.

Here is my prob.
When i save the file again as a .txt there have been tabs added to it.
I think this will casue problems to my upload.
I've tried saving as ms-dos txt, tab-delimted txt..., but to no avail.

has anyone any ideas on what i can do?

I'm open to approaching the problem in a completely different manner,
i.e. Access, SQL server??

BTW the data in the .txt file is seperated by spaces.

Regards,
Ciarán
 
Ciarán,

You could use a little trick; open in Excel, make a second copy of column A
in column B, split column B to columns (while A remains intact), sort the
whole sheet on whichever column required, then delete all columns from B on;
Column A will now have the original text sorted as required. Save again as
text and you're done.

HTH,
Nikos
 
Dave,

The Text Write Program is still at Tushar's site, and I hope he keeps it for
the benefit of those who have that location stored. If there are any
upgrades, I'll send them to Tushar, and hope he'll keep carrying it. I've
not gotten any emails about it, so either no one's using it, or it's working
OK! The latter, I hope. :)

Oops. I see that his site has my old email address. No wonder. Think I'll
write to him.
 
Create a new column, with teh following formula...

=A1&" "&B1&" "&C1&" "&D1

continuing for as many columns as you have. Then simply copy and paste
the new column into notepad.


--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk


Ciar?n hu kiteb:
 
Nikos Yannacopoulos said:
Ciarán,

You could use a little trick; open in Excel, make a second copy of column A
in column B, split column B to columns (while A remains intact), sort the
whole sheet on whichever column required, then delete all columns from B on;
Column A will now have the original text sorted as required. Save again as
text and you're done.

HTH,
Nikos


Very clever, Nikos, Very clever.
Its always the simple little ideas that are best!

I'm very close to achieving what I want now, but have a new
problem.....
Here is the same line of data as it appears in notepad, before and
after I do my sorting in excel.
Before
22/08/04 554199 "014" 0 "000197" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

After
"22/08/04 554199 ""014"" 0 ""000197"" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"

Does anyone know how to prevent the extra inverted commas from being
added by Excel.

Regards,
Ciarán
 
Ciarán,

This has nothing to do with the sorting, I'm afraid, the same would happen
if you just opened the text file in Excel and saved without doing anything
else; it's Excel's way of dealing with quotes, for some obscure reason, and
I don't know how (or even if) it can be prevented.
If you don't mind getting rid of all the quotes altogether, just do a Find
and Replace with nothing (or some other character, if that suits you) before
you save.
Another alternative is the one suggested by Fabian: once you,ve sorted, copy
the original column A and past into Notepad, then save from there. That does
the trick.

HTH,
Nikos
 
Back
Top