Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have multiple .txt files that I am able to combine into one big .txt file. What I'd like to do before combining is have each file name be a column inside the .txt file. The filename is a date that is helpful when I eventually export the data into Excel.

When combining the .txt files, the file name does come in as a row...but not a column.

Thanks for any ideas or suggestions.

share|improve this question
    
I would be helpful if you post your sample input and output. –  kev Apr 13 '12 at 12:24
    
Also what your OS is. –  EBGreen Apr 13 '12 at 12:33

1 Answer 1

$ perl -ne 'print "$ARGV,$_"' one two > three

$ cat three
one,aaa
one,bbb
two,ccc
two,ddd

$ cat one
aaa
bbb

$ cat two
ccc
ddd

Perl is included in most Linux distributions and is a free download on Windows.

share|improve this answer
    
Thanks RGB.....I'm going to take a whack at it now –  Dojo Apr 13 '12 at 12:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.