Sponsored Content
Full Discussion: Split a line and append pipe
Top Forums Shell Programming and Scripting Split a line and append pipe Post 302581346 by birei on Tuesday 13th of December 2011 02:58:34 AM
Old 12-13-2011
Hi greenworld123,

Try next 'perl' program:
Code:
$ cat script.pl
use warnings;
use strict;

while ( <DATA> ) {
        chomp;
        printf qq[%s\n], join ( qq[|], unpack( qq[A3 A5 A1 A9 A7 A2], $_ ) );
}

__DATA__
030150678  bos  00156     0500405612      23       23
$ perl script.pl
030|15067|8|  bos  00|156| 0

Regards,
Birei
This User Gave Thanks to birei For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to split pipe delimited file

I have a pipe delimited input file as below. First byte of the each line indicate the record type. Then i need to split the file based on record_type = null,0,1,2,6 and create 5 files. How do i do this in a ksh script? Pls help |sl||SL|SL|SL|1996/04/03|1988/09/15|C|A|sl||||*|... (4 Replies)
Discussion started by: njgirl
4 Replies

2. Shell Programming and Scripting

Append line that does not contain pipe to it previous line

Hi All, I have a file which contains data as below When we see no pipe character in the line. append those lines to the previous line with pipe character till we get the next line with pipe character with ~(concat with ~) Input file looks like: 1080530944|001|john.l.bonner|Acknowledge|CN... (11 Replies)
Discussion started by: ainuddin
11 Replies

3. Shell Programming and Scripting

Append next line to previous line when one pattern not found

Hi, I need help for below scenario.I have a flat file which is having records seperated by delimiters which will represent each record for oracle table.My Control file will consider each line as one record for that table. Some of the lines are aligned in two/three lines so that records are... (4 Replies)
Discussion started by: kannansr621
4 Replies

4. Shell Programming and Scripting

Print pipe separated list as line by line in Korn Shell

Korn Shell in AIX 6.1 I want to print the below shown pipe (|) separated list line by line. line=es349889|nhb882309|ts00293|snh03524|bg578835|bg37900|rnh00297|py882201|sg175883 for i in line do echo "Hello $line " done I wanted to execute the above for loop. But i can't even set the... (3 Replies)
Discussion started by: polavan
3 Replies

5. UNIX for Dummies Questions & Answers

How to remove fields space and append next line to previous line.?

awk 'BEGIN{FS = "Ç"} NR == 1 {p = $0; next} NF > 1 {print p; p = $0} NF <= 1 {p = (p " " $0)} END {print p}' input.txt > output.txt This is what the input data file looks like with broken lines Code: 29863 Ç890000000 Ç543209911 ÇCHNGOHG Ç000000001 Ç055 ... (4 Replies)
Discussion started by: cumeh1624
4 Replies

6. Shell Programming and Scripting

sed command to replace a line in a file using line number from the output of a pipe.

Sed command to replace a line in a file using line number from the output of a pipe. Is it possible to replace a whole line piped from someother command into a file at paritcular line... here is some basic execution flow.. the line number is 412 lineNo=412 Now i have a line... (1 Reply)
Discussion started by: vivek d r
1 Replies

7. Shell Programming and Scripting

Append Next line with current Line bassed on condition

Hi, I have an XML file and I am tring to extract some data form it, after lot of data cleaning process, I ended up with an issue, and need your urgent support. my current input data in below format: <Node>xxxxxx <Node>yyyyy</Node> <Node>zzzzzz <Node>12345</node> I need... (9 Replies)
Discussion started by: rramkrishnas
9 Replies

8. Shell Programming and Scripting

Remove new line starting with a numeric value and append it to the previous line

Hi, i have a file with multiple entries. After some tests with sed i managed to get the file output as follows: lsn=X-LINK-IN0,apc=661:0,state=avail,avail/links=1/1, 00,2110597,2094790,0,81,529,75649011,56435363, lsn=TM1ITP1-AM1ITP1-LS,apc=500:0,state=avail,avail/links=1/1,... (5 Replies)
Discussion started by: nms
5 Replies

9. UNIX for Beginners Questions & Answers

awk command to split pipe delimited file

Hello, I need to split a pipe de-limited file based on the COLUMN 7 value . If the column value changes I need to split the file Source File Payment|ID|DATE|TIME|CONTROLNUMBER|NUMBER|NAME|INDICATOR 42156974|1137937|10/1/2018|104440|4232|2054391|CARE|1... (9 Replies)
Discussion started by: rosebud123
9 Replies

10. UNIX for Beginners Questions & Answers

Append pipe | at the end of all the rows except header n trailer for all the files under a directory

Hi Experts Need help... I am looking for a Unix script to append pipe | at the end of all the rows (except header and trailer)in all the files placed under the directory /interfaces/Temp e.g. Header row1 row2 row3 Trailer The script should read all the files under... (3 Replies)
Discussion started by: phani333
3 Replies
BOS_SETRESTRICTED(8)					       AFS Command Reference					      BOS_SETRESTRICTED(8)

NAME
bos_setrestricted - place a server in restricted mode SYNOPSIS
bos setrestricted -server <machine name> -mode 1 [-cell <cell name>] [-noauth] [-localauth] [-help] DESCRIPTION
The bos restricted command places the server in restricted mode. This mode increases the security of the bos server by removing access to a number of bos commands that are only used whilst configuring a system. When a server is in restricted mode, access to bos_exec, bos uninstall, bos install, bos create, bos install, bos delete, bos prune is denied, and the use of bos getlog is limited. CAUTIONS
Once a server has been placed in restricted mode, it may not be opened up again using a remote command. That is, bos setrestricted has no method of setting an unrestricted mode. Once a server is restricted, it can only be opened up again by sending it a SIGFPE, which must be done as root on the local machine. OPTIONS
-server <machine name> Indicates the server machine to restrict. -cell <cell name> Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see bos(8). -noauth Assigns the unprivileged identity "anonymous" to the issuer. Do not combine this flag with the -localauth flag. For more details, see bos(8). -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The bos command interpreter presents the ticket to the BOS Server during mutual authentication. Do not combine this flag with the -cell or -noauth options. For more details, see bos(8). -help Prints the online help for this command. All other valid options are ignored. PRIVILEGE REQUIRED
The issuer must be listed in the /etc/openafs/server/UserList file on the machine named by the -server argument, or must be logged in as the local superuser "root" if the -localauth flag is included. As noted above, this command cannot be run against servers which are already in restricted mode. SEE ALSO
bos(8) COPYRIGHT
Copyright 2009 Simon Wilkinson <simon@sxw.org.uk> This documentation is covered by the BSD License as written in the doc/LICENSE file. This man page was written by Simon Wilkinson for OpenAFS. OpenAFS 2012-03-26 BOS_SETRESTRICTED(8)
All times are GMT -4. The time now is 07:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy