Insert Text On file

Hi All,

Can someone pls help me to insert some text on a file.

my file contains something like below..

AKBULBU,
BALUMIL,
BATCH,BATCH
BOARROB,
BOTAKAT,
C57896,
CAKIOZE,
CHECMER,
CICOFRA,
CISZPAW,2194485

I want output as

USER_ID, LOGIN_ID
AKBULBU,
BALUMIL,
BATCH,BATCH
BOARROB,
BOTAKAT,
C57896,
CAKIOZE,
CHECMER,
CICOFRA,
CISZPAW,2194485

echo "USER_ID, LOGIN_ID" > tmp; 
cat file >> tmp; 
## at this point check the content of tmp before you do this, mv will erase the 
mv tmp file

Hia,

You can also use:

sed '1i\ USER_ID, LOGIN_ID' file_name > new_filename
cp new_filename file_name
rm new_filename

Cheers,
Shazin

Hi jim,

Can same be done by using SED

hi shazin,

When iam doing this iamgetting error

$ sed '1i\ USER_ID, LOGIN_ID' userdata.csv >newfile
sed: command garbled: 1i\ USER_ID, LOGIN_ID

Hi ,

Please can you make use of CODE options on the control bar to keep the Forum tidy.

Thanks,
Shazin

hi shazin,

When iam doing this iamgetting error

$ sed '1i\ USER_ID, LOGIN_ID' userdata.csv >newfile
sed: command garbled: 1i\ USER_ID, LOGIN_ID