indenting lines to the left


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers indenting lines to the left
# 1  
Old 10-11-2007
indenting lines to the left

hi

i have a file which is like this :
Code:
aab ghj
  ghj lsklk
    lklkl;
ashjd
  kjs
  alskj

How do i remove the spaces from the beginning of a line so that all lines are indented to the left?

Last edited by zazzybob; 10-11-2007 at 05:37 AM.. Reason: added code tags
# 2  
Old 10-11-2007
Code:
sed "s/^ *//" file_in > file_out

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

How much resources is left on the P7?

I know that it is possible to login into the HMC console and view all the specs like, how much CPU/RAM every LPAR has. But how can I check how much the whole P7 has in total and how much is left to creat a new LPAR:wall: (5 Replies)
Discussion started by: DiViN3
5 Replies

2. Shell Programming and Scripting

File count from where it left??

i have this code num=1 dat10=`date "+%m/%d/%Y" -d "+10 days"` dat=`date "+%m/%d/%Y"` set -x grep "text=.&" /root/Softwares/apache-tomcat-5.5.30/logs/catalina.out|awk -F"from=" '{print $2}'|awk -F"opid" '{print $1}'|sort|uniq > pnos while read line do psql -U poss -d emsver -c "insert into... (3 Replies)
Discussion started by: nikhil jain
3 Replies

3. Shell Programming and Scripting

Is it possible to index substr from right to left?

Hello, all Suppose I have a string "0123456789", if i want to get the substr "56", I know I can use following method: $ string="0123456789" $ echo ${string:5:2} 56 I am wondering if there is some command like: $ echo ${string:6:-2} which can also get the same output "56"? (3 Replies)
Discussion started by: littlewenwen
3 Replies

4. Shell Programming and Scripting

left join using awk

Hi guys, I need AWK to merge the following 2 files: file1 1 a 1 1 2 b 2 2 3 c 3 3 4 d 4 4 file2 a a/a c/c a/c c/c a/a c/t c c/t c/c a/t g/g c/c c/t desired output: 1 a 1 1 a/a c/c a/c c/c a/a c/t 2 b 2 2 x x x x x x 3 c 3 3 c/t c/c a/t g/g c/c c/t 4 d 4 4 x x x x x x (2 Replies)
Discussion started by: g1org1o
2 Replies

5. Shell Programming and Scripting

left join using awk

Hi guys, I need to use awk to join 2 files file_1 A 001 B 002 C 003 file_2 A XX1 B XX2 output desired A 001 XX1 B 002 missing C 003 XX2 thank you! (2 Replies)
Discussion started by: g1org1o
2 Replies

6. Shell Programming and Scripting

No Space left On Device

Hi, We are trying to sort the 40GB file in unix and getting following error. Error: sort: can't write /var/tmp/stmAAAvsaGfJ.00002929: No space left on device sort -t ',' -k4 $DIR/INF_ff_FULL.dat >>$DIR/Sort_INF_ff_FULL.dat; 2>$DIR/sort_error.log Can you please advise how to... (2 Replies)
Discussion started by: koti_rama
2 Replies

7. Shell Programming and Scripting

using cut command right to left

Hi guys I have variable that contains a full directory path. var=/tmp/a/b/c/d I want to be able to extract different directories in the path right to left while using / as the delimiter. so for e.g. if in the above example if I want c then I want it to be in the middle of 1st and... (2 Replies)
Discussion started by: alinaqvi90
2 Replies

8. Solaris

No space left on device

Hi all, A very strange problem I have this morning with my Solaris 8. I have a FS full, I deleted some files but the system doesn't seems to reallocate the free space (I'm using Veritas): df -k : /dev/vx/dsk/dlds02vg/dlds02oralv 4194304 4194304 0 100% /dlds02/lds/oracle ... (4 Replies)
Discussion started by: unclefab
4 Replies

9. UNIX for Dummies Questions & Answers

Left filled with zeros

Hi A question about numeric display there... Is there any option in awk that would prints a number with "left filled with zero" format, and how does it work with variable length definition? For instance IŽd like my variable to be left filled with 0s for a length of 3 in total: 4 would be... (3 Replies)
Discussion started by: Indalecio
3 Replies

10. Shell Programming and Scripting

what left of the pattern

I have a script which loop through a directory then report any file matches the given pattern, say, the pattern is "a2006", this file would be returned a20061101.txt I would like to know how can I get the remaining of the filename, so a20061101txt - a2006 = 1101.txt Can anybody help? Thank... (2 Replies)
Discussion started by: mpang_
2 Replies
Login or Register to Ask a Question