Results 1 to 5 of 5
I have tried to find a way to correct a problem I am having with a file being written. I write the file using these commands:
Code:
gawk -F"\t" '{ ...
- 03-11-2008 #1Just Joined!
- Join Date
- Oct 2007
- Location
- Houston
- Posts
- 75
Replace remove white spaces after a tab
I have tried to find a way to correct a problem I am having with a file being written. I write the file using these commands:
Instead of getting tabs I get a tab with a few spaces. I want to remove the space. I have tried different sed strings to get this done but it still does not work. Any thoughts?Code:gawk -F"\t" '{ print $2"\t" $3"\t" | "sort" }' backupsets > bset1 awk NF bset2 > bset3 sed /"ACCT #"/d bset3 >bset4 sed /"800-000-0000"/d bset4 >bset5 sed /"713-000-0000"/d bset5 > bset6 tr '[a-z]' '[A-Z]' < bset6 > cbset sed 's/^ //g' cbset >cbset1 rm -rf bset*
- 03-12-2008 #2Linux User
- Join Date
- Aug 2006
- Posts
- 458
you don't need to use that much *nix tools ..as always, show your input and describe your output.
- 03-14-2008 #3Just Joined!
- Join Date
- Oct 2007
- Location
- Houston
- Posts
- 75
When I am done with that top part the file looks like
Instead of the spaces from ACC00600AK and DG it should be a tab then the last part.Code:ACC006000AK WWW1\FILES ON C$,SYSTEM STATE AND SERVICES DATABASE\ADMIN001 ACC006000AK WWW1\MICROSOFT SQL SERVER\ADMIN001 ACC006000AK WWW2\FILES ON C$,SYSTEM STATE AND SERVICES DATABASE\ADMIN002 ACC006000AK WWW2\MICROSOFT SQL SERVER\ADMIN001 ACC006000DG MYSQL\192.168.100.120\INFORMATION_SCHEMA, LAVA, MYSQL\ADROOT ACC006000DG UNIX-SSH\172.16.40.53\/*\ADROOT
- 03-14-2008 #4
This isn't very helpful, since posting it on the forum removes tabs.
Show us what the original file (before you did anything) looks like, describe it in words (so we don't miss anything), and then do the same to what the final result should be.DISTRO=Arch
Registered Linux User #388732
- 03-14-2008 #5
Are you trying to replace white spaces to get tabs? And as Cabhan said attach files (input.txt and desired_output.txt).


Reply With Quote