line separate (pls)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting line separate (pls)
# 1  
Old 12-03-2009
line separate (pls)

Hello everybody
I made code to move some files to another place for example(I moved MM file TO BIN folder ) and the MM path I put it in different file e.g(0:HOME/unixstuff/MM) so my question is who I can separate the path line and use the number 0: and MM as parameter because if I want to move mm file back to original place and I use number before the path line because might I have two files same name in different directory.
I think to separate it I use cat commend but i am not sure ????
thanks
# 2  
Old 12-03-2009
Code:
cut -d: -f2 infile

# 3  
Old 12-04-2009
Excuse me quirkasaurus.

How can put in if condition or for loop to test it before I move it back because I have more files?
And in file path, I have to put any cod or not?
this is one file path which will put it in path file(echo 2009:$i:$(pwd)/$1 >> $HOME/tmp)
will show me(2009:0:HOME/unixstuff/MM )

and another file will show me (2009:1:HOME/unixstuff/dd )
.
.
.

thanks

---------- Post updated 12-04-09 at 02:12 PM ---------- Previous update was 12-03-09 at 03:00 PM ----------

any help please

Last edited by falm; 12-03-2009 at 06:18 PM.. Reason: make clear
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Output to file print as single line, not separate line

example of problem: when I echo "$e" >> /home/cogiz/file.txt result prints to file as:AA BB CC I need it to save to file as this:AA BB CC I know it's probably something really simple but any help would be greatly appreciated. Thank You. Cogiz (7 Replies)
Discussion started by: cogiz
7 Replies

2. Shell Programming and Scripting

[Solved] How to separate one line to mutiple line based on certain number of characters?

hi Gurus, I need separate a file which is one huge line to multiple lines based on certain number of charactors. for example: abcdefghi high abaddffdd I want to separate the line to multiple lines for every 4 charactors. the result should be abcd efgh i hi gh a badd ffdd Thanks in... (5 Replies)
Discussion started by: ken6503
5 Replies

3. Shell Programming and Scripting

How to separate one line to mutiple line based on one char?

Hi Gurus, I need separate one file which is one huge line to mutiple line. file like abcd # bcd # def # fge # ged I want to get abcd bcd def fge ged Thanks in advance (4 Replies)
Discussion started by: ken6503
4 Replies

4. Shell Programming and Scripting

Read each line and saving the line in separate files

Hi Experts, I am having a requirement like this; Input file EIM_ACCT.ifb|1001|1005 EIM_ADDR.ifb|1002|1004 EIM_ABD.ifb|1009|1007 I want to read each line of this file and pass each line,one at a time,as an argument to another script. eg; 1.read first line->store it to a file->call... (2 Replies)
Discussion started by: ashishpanchal85
2 Replies

5. Shell Programming and Scripting

[Solved] making each word of a line to a separate line

Hi, I have a line which has n number of words with separated by space. I wanted to make each word as a separate line. for example, i have a file that has line like i am a good boy i want the output like, i am a good (8 Replies)
Discussion started by: rbalaj16
8 Replies

6. Shell Programming and Scripting

What's wrong with this command line pls?

I executed the following command and got Arg List too long. find /dir1/dir2/LOG_* -prune -type f -mtime +3 -exec echo {} \; What's that about? (2 Replies)
Discussion started by: bbbngowc
2 Replies

7. Shell Programming and Scripting

Replace a line with a separate line in code

I have a bunch of files that are like this: <htmlstuffs>HTML STUFFS</endhtmlstuffs> <h1>Header</h1> <htmlstuffs>HTML STUFFS</endhtmlstuffs> <h1>Unique</h1> <html stuffs>HTML STUFFS</endhtmlstuffs> And Here's what I'd like it to look like: <htmlstuffs>HTML STUFFS</endhtmlstuffs>... (2 Replies)
Discussion started by: kason
2 Replies

8. Shell Programming and Scripting

separate a line having particular field

hi i have a file containes data like, 20081013-030618.675199 D 17 Change state DATA_RECEIVE->EOD, RC=0 20081013-030618.868358 D 17 Reading data... 20081013-030618.868498 D 18 Received 5 bytes 20081013-030618.868537 U Buffer received: now i need to cut the 4th field i.e 17 and write... (2 Replies)
Discussion started by: Satyak
2 Replies

9. Shell Programming and Scripting

How to get it in single line. pls help

Hi, when i am executing this script, i am getting the values of TID and Intime in different lines. How can i print both output values in a single line. please advise _____________________________ #!/bin/ksh export Path="/abc/def/ghi"; Home="/abc/jkl/prt"; cd $Path cat $Home | while read... (3 Replies)
Discussion started by: Prat007
3 Replies

10. UNIX for Dummies Questions & Answers

One line of cron is not working - PLS Help

Hi all, I have spent 2 hours going through the forum and have not found an answer to my question, I hope someone can help. I have cron setup to run two commands, one at 1am and one at 3 am, the one at 1 am works but not the one at 3 am. The time is set as: 0 1 * * * /path/to/file 0 3 * * *... (3 Replies)
Discussion started by: burnie
3 Replies
Login or Register to Ask a Question