Sponsored Content
Top Forums Shell Programming and Scripting How do you use pull data from multiple lines to do a for statement? Post 302384906 by Corona688 on Wednesday 6th of January 2010 03:36:56 PM
Old 01-06-2010
You could convert newlines to spaces, then add newlines back only where you want them:
Code:
tr '\n' ' ' < input | sed 's/}/}\n/g' | while read LINE
do
        ...
done

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Split data into multiple lines

All, I have a requirement where I will need to split a line into multiple lines. Ex: Input: 2ABCDEFGH2POIYUY2ASDGGF2QWERTY Output: 2ABCDEFGH 2POIYUY 2ASDGGF 2QWERTY The data is of no fixed lenght. Only the lines have to start with 2. How can this be done. (5 Replies)
Discussion started by: kingofprussia
5 Replies

2. Shell Programming and Scripting

(sed) parsing insert statement column that crosses multiple lines

I have a file with a set of insert statements some of which have a single column value that crosses multiple lines causing the statement to fail in sql*plue. Can someone help me with a sed script to replace the new lines with chr(10)? here is an example: insert into mytable(id, field1, field2)... (3 Replies)
Discussion started by: jjordan
3 Replies

3. Shell Programming and Scripting

Outputting data from multiple lines

Hi guys, looking for a bit of advise, and as I am a complete novice, please excuse the daft questions!! I have a list of events and of which entry looks like this; # # Event 1 # NAME = Event 1 # 12345 : 123 : 1 : 1 : L,1,N : 1,0 : Event # # Event 2 # NAME = Event 2 # 12346... (8 Replies)
Discussion started by: JayC89
8 Replies

4. Shell Programming and Scripting

multiple lines inside a case statement

echo "please enter ur choice.. 1. Make a file. 2. Display contents 3. Copy the file 4. Rename the file 5. Delete the file 6. Exit" read choice case $choice in 1 ) echo enter the file name read fname if then echo... (2 Replies)
Discussion started by: gotam
2 Replies

5. UNIX for Dummies Questions & Answers

Pull out multiple lines with grep patternfile

Hi, I'm trying to get lines from a file using identifiers in the first two columns. I have used: cat MasterFile.txt | grep -f Pattern.txt and the lines I want display on screen. If I try to put them in a file the file is created but stays empty: cat MasterFile.txt | grep -f Pattern.txt... (14 Replies)
Discussion started by: FGPonce
14 Replies

6. Shell Programming and Scripting

Extracting data from multiple lines

Hi All, I am stuck in one step.. I have one file named file.txt having content: And SGMT.perd_id = (SELECT cal.fiscal_perd_id FROM $ODS_TARGT.TIM_DT_CAL_D CAL FROM $ODS_TARGT.GL_COA_SEGMNT_XREF_A SGMT SGMT.COA_XREF_TYP_IDN In (SEL COA_XREF_TYP_IDN From... (4 Replies)
Discussion started by: Shilpi Gupta
4 Replies

7. Shell Programming and Scripting

How do I use grep to pull incremental data and send to multiple files?

Hi Everyone, Im currently using the below code to pull data from a large CSV file and put it into smaller files with just the data associated with the number that I "grep". grep 'M053' test.csv > test053.csv Is there a way that I can use grep to run through my file like the example below... (6 Replies)
Discussion started by: TheStruggle
6 Replies

8. Shell Programming and Scripting

Split data into multiple lines

Hi, if i have data like below: Control|AC-00011-CN-2475208 AC-00011-CN-2475211 AC-00007-CN-2475238 AC-00007-CN-2475241 Im getting output in required format as below Control|AC-00011-CN-2475208 Control|AC-00011-CN-2475211 Control|AC-00007-CN-2475238 Control|AC-00007-CN-2475241 using awk... (9 Replies)
Discussion started by: JSKOBS
9 Replies

9. UNIX for Beginners Questions & Answers

Multiple lines of data?

I use this to get 8 random letters: cat /dev/urandom | tr -dc 'A-Z' | fold -w 8 | head -n 1 Result is, WLGFJFZY What I'm trying to do is get 10 lines of random letters, separated by a line and each block having ascending numbers i.e; 00 IWMTDFIM 01 KZZZCHPQ 02 YBTGFHGT 03 (4 Replies)
Discussion started by: jenny-mac
4 Replies
smd-pull(1)						 Sync Mail Dir (smd) documentation					       smd-pull(1)

NAME
smd-pull - syncs the local mail dir letting the remote one untouched SYNOPSIS
smd-pull [-d|--dry-run] [-v|--verbose] [-s|--show-tags] [-t|--template-only] [-n|--no-delete] [endpoint] DESCRIPTION
smd-pull performs in the local maildir all the changes that were performed on remote one. No changes are made on the remote maildir. Use smd-push(1) for that. Refer to smd-config(5) for the configuration file format. OPTIONS
-v --verbose Verbose output -s --show-tags Machine readable output -d --dry-run Do not perform any action for real -n --no-delete Do not propagate deletions -t --template-only Just create a template configuration file if none endpoint Is the suffix for the name of the configuration file to use. If it is omitted, the configuration file ~/.smd/config.default is used. FILES
~/.smd/config.* ~/.smd/hooks/pre-pull.d/ ~/.smd/hooks/post-pull.d/ SEE ALSO
mddiff(1), smd-server(1), smd-client(1), smd-push(1), smd-loop(1), smd-config(5) AUTHOR
Enrico Tassi <gares@fettunta.org> 11 June 2012 smd-pull(1)
All times are GMT -4. The time now is 01:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy