Assuming the filenames end with .txt and have no spaces.
TAB=$(printf "\t"); for n in $(ls); do TITLE=$(basename -s .txt $
{n} ); cat ${n} | sed -E "s/$/${TAB}${TITLE}/g" > ${TITLE}_new.txt;
done;
Will.
On May 29, 4:18 am, LuKreme wrote:
> On 28-May-2010, at 07:48, Tim Gray wrote:
>
> > On May
On 28-May-2010, at 07:48, Tim Gray wrote:
> On May 28, 2010 at 07:40 AM -0500, dp wrote:
>> I have 57 files. Each contains a list of student names. In order to import
>> into a database, I need to append the filename to the end of each line in
>> each file. To use a simplified example, the Basket
On May 28, 2010 at 09:10 AM -0500, dp wrote:
If only I knew how. But it's a moot point. I finally bit the bullet and did
it file by file. It was tedious, but not as time-consuming as I had
expected.
I won't write one up then :)
It is a skill worth acquiring if you do this kind of stuff period
If only I knew how. But it's a moot point. I finally bit the bullet and did it
file by file. It was tedious, but not as time-consuming as I had expected.
Thanks, Tim.
***
On May 28, 2010, at 8:48 AM , Tim Gray wrote:
On May 28, 2010 at 07:
On May 28, 2010 at 07:40 AM -0500, dp wrote:
I have 57 files. Each contains a list of student names. In order to import
into a database, I need to append the filename to the end of each line in
each file. To use a simplified example, the Basketball_Boys.tab file
contains
Sounds like the job f
I'll experiment with that. Thanks, Steve.
***
On May 28, 2010, at 8:30 AM , Steve Kalkwarf wrote:
Yes, it's easy for one file, and I'll do it that way if necessary. I was rather
hoping for some function that allowed a multi-file replacement
> Yes, it's easy for one file, and I'll do it that way if necessary. I was
> rather hoping for some function that allowed a multi-file replacement of \r
> with \t[filename]\r.
There is no token for filename in the replace mechanics, but you could write an
AppleScript to do this:
tell applicati
Thanks, Brian.
Yes, it's easy for one file, and I'll do it that way if necessary. I was rather
hoping for some function that allowed a multi-file replacement of \r with
\t[filename]\r.
dp
***
On May 28, 2010, at 7:49 AM , Brian Frick wrot
At the very least, you could do Text -> Prefix/Suffix lines with " \t
Basketball_Boys " in suffix for that file. You'd have to do each file
separately, but that's super easy.
--
Brian
On May 28, 2010, at 7:40 AM, dp wrote:
> I have 57 files. Each contains a list of student names. In order t
I have 57 files. Each contains a list of student names. In order to import into
a database, I need to append the filename to the end of each line in each file.
To use a simplified example, the Basketball_Boys.tab file contains
Andy [tab] Aardvark
Billy [tab] Badger
Carl [tab] Cougar
I need for
10 matches
Mail list logo