Sponsored Content
Top Forums Shell Programming and Scripting How to ignore Pipe in Pipe delimited file? Post 302842877 by Jotne on Sunday 11th of August 2013 03:24:39 AM
Old 08-11-2013
You can get hold of GNU Awk 4.0+ and then use FPAT to solve this.
Splitting By Content - The GNU Awk User's Guide
 

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

How to generate a pipe ( | ) delimited file?

:)Hi Friends, I have certain log files extracted. I want it to be converted in pipe ( | ) delimited file. How do i do it? E.g. Account Balance : 123456789 Rs O/P (Account Balance: | 123456789 Rs) Account Balance (Last) > 987654321 Rs O/P (Account Balance (Last) | 987654321 Rs) Last... (5 Replies)
Discussion started by: anushree.a
5 Replies

3. UNIX for Dummies Questions & Answers

Extracting from pipe delimited file.

Hey, I am new to regualar expression. I wanted to extract the information from a pipe delimited file which has some entries like L|S2CMG1B|||-11178399||1|-8.65|IRCSH|BOND||||N|S|IRDL|AUD||CRP|STD|CRP|M|0|1|||CSH||||OTHER|01|DE|KFW|50418Y9T5|||||||||||2|||||| In this I want to extract the... (1 Reply)
Discussion started by: leepan2008
1 Replies

4. Shell Programming and Scripting

convert a pipe delimited file to a':" delimited file

i have a file whose data is like this:: osr_pe_assign|-120|wg000d@att.com|4| osr_evt|-21|wg000d@att.com|4| pe_avail|-21|wg000d@att.com|4| osr_svt|-11|wg000d@att.com|4| pe_mop|-13|wg000d@att.com|4| instar_ready|-35|wg000d@att.com|4| nsdnet_ready|-90|wg000d@att.com|4|... (6 Replies)
Discussion started by: priyanka3006
6 Replies

5. UNIX for Dummies Questions & Answers

Delete last value from pipe delimited file

I have a large(ish) pipe delimited file. The last line of the file contains a total row count and a checksum: END|1537451|1328569446 After making other adjustments to the file, I need to strip out the checksum and apply a new value - I have a script to generate the checksum and 'cat' it... (3 Replies)
Discussion started by: relentl3ss
3 Replies

6. Shell Programming and Scripting

How to convert a space delimited file into a pipe delimited file using shellscript?

Hi All, I have space delimited file similar to the one as shown below.. I need to convert it as a pipe delimited, the values inside the pipe delimited file should be as highlighted... AA ATIU2345098809 009697 005374 BB ATIU2345097809 005445 006518 CC ATIU9685098809 003215 003571 DD... (7 Replies)
Discussion started by: nithins007
7 Replies

7. UNIX for Dummies Questions & Answers

Reading a pipe delimited file

Hi Guys, i am reading a pipe delimited file using awk command. I have tested the gawk separately. it was fine. But when i execute the script. i am getting the following error saying command not found. Can somebody point out as what i am doing wrong. Cheers!!! (3 Replies)
Discussion started by: mac4rfree
3 Replies

8. UNIX for Advanced & Expert Users

Check Whether File is Pipe Delimited

Can anybody help me how to check whether a file is Pipe delimited or not? (1 Reply)
Discussion started by: Allwin333
1 Replies

9. Shell Programming and Scripting

Help with converting Pipe delimited file to Tab Delimited

I have a file which was pipe delimited, I need to make it tab delimited. I tried with sed but no use cat file | sed 's/|//t/g' The above command substituted "/t" not tab in the place of pipe. Sample file: abc|123|2012-01-30|2012-04-28|xyz have to convert to: abc 123... (6 Replies)
Discussion started by: karumudi7
6 Replies

10. UNIX for Dummies Questions & Answers

Need to convert a pipe delimited text file to tab delimited

Hi, I have a rquirement in unix as below . I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column. ex: Input Text file: 1|A|apple 2|B|bottle excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 Replies
HTTP::Request::Common(3)				User Contributed Perl Documentation				  HTTP::Request::Common(3)

NAME
HTTP::Request::Common - Construct common HTTP::Request objects SYNOPSIS
use HTTP::Request::Common; $ua = LWP::UserAgent->new; $ua->request(GET 'http://www.sn.no/'); $ua->request(POST 'http://somewhere/foo', [foo => bar, bar => foo]); DESCRIPTION
This module provide functions that return newly created "HTTP::Request" objects. These functions are usually more convenient to use than the standard "HTTP::Request" constructor for the most common requests. The following functions are provided: GET $url GET $url, Header => Value,... The GET() function returns an "HTTP::Request" object initialized with the "GET" method and the specified URL. It is roughly equivalent to the following call HTTP::Request->new( GET => $url, HTTP::Headers->new(Header => Value,...), ) but is less cluttered. What is different is that a header named "Content" will initialize the content part of the request instead of setting a header field. Note that GET requests should normally not have a content, so this hack makes more sense for the PUT() and POST() functions described below. The get(...) method of "LWP::UserAgent" exists as a shortcut for $ua->request(GET ...). HEAD $url HEAD $url, Header => Value,... Like GET() but the method in the request is "HEAD". The head(...) method of "LWP::UserAgent" exists as a shortcut for $ua->request(HEAD ...). PUT $url PUT $url, Header => Value,... PUT $url, Header => Value,..., Content => $content Like GET() but the method in the request is "PUT". The content of the request can be specified using the "Content" pseudo-header. This steals a bit of the header field namespace as there is no way to directly specify a header that is actually called "Content". If you really need this you must update the request returned in a separate statement. DELETE $url DELETE $url, Header => Value,... Like GET() but the method in the request is "DELETE". This function is not exported by default. POST $url POST $url, Header => Value,... POST $url, $form_ref, Header => Value,... POST $url, Header => Value,..., Content => $form_ref POST $url, Header => Value,..., Content => $content This works mostly like PUT() with "POST" as the method, but this function also takes a second optional array or hash reference parameter $form_ref. As for PUT() the content can also be specified directly using the "Content" pseudo-header, and you may also provide the $form_ref this way. The $form_ref argument can be used to pass key/value pairs for the form content. By default we will initialize a request using the "application/x-www-form-urlencoded" content type. This means that you can emulate an HTML <form> POSTing like this: POST 'http://www.perl.org/survey.cgi', [ name => 'Gisle Aas', email => 'gisle@aas.no', gender => 'M', born => '1964', perc => '3%', ]; This will create an HTTP::Request object that looks like this: POST http://www.perl.org/survey.cgi Content-Length: 66 Content-Type: application/x-www-form-urlencoded name=Gisle%20Aas&email=gisle%40aas.no&gender=M&born=1964&perc=3%25 Multivalued form fields can be specified by either repeating the field name or by passing the value as an array reference. The POST method also supports the "multipart/form-data" content used for Form-based File Upload as specified in RFC 1867. You trigger this content format by specifying a content type of 'form-data' as one of the request headers. If one of the values in the $form_ref is an array reference, then it is treated as a file part specification with the following interpretation: [ $file, $filename, Header => Value... ] [ undef, $filename, Header => Value,..., Content => $content ] The first value in the array ($file) is the name of a file to open. This file will be read and its content placed in the request. The routine will croak if the file can't be opened. Use an "undef" as $file value if you want to specify the content directly with a "Content" header. The $filename is the filename to report in the request. If this value is undefined, then the basename of the $file will be used. You can specify an empty string as $filename if you want to suppress sending the filename when you provide a $file value. If a $file is provided by no "Content-Type" header, then "Content-Type" and "Content-Encoding" will be filled in automatically with the values returned by LWP::MediaTypes::guess_media_type() Sending my ~/.profile to the survey used as example above can be achieved by this: POST 'http://www.perl.org/survey.cgi', Content_Type => 'form-data', Content => [ name => 'Gisle Aas', email => 'gisle@aas.no', gender => 'M', born => '1964', init => ["$ENV{HOME}/.profile"], ] This will create an HTTP::Request object that almost looks this (the boundary and the content of your ~/.profile is likely to be different): POST http://www.perl.org/survey.cgi Content-Length: 388 Content-Type: multipart/form-data; boundary="6G+f" --6G+f Content-Disposition: form-data; name="name" Gisle Aas --6G+f Content-Disposition: form-data; name="email" gisle@aas.no --6G+f Content-Disposition: form-data; name="gender" M --6G+f Content-Disposition: form-data; name="born" 1964 --6G+f Content-Disposition: form-data; name="init"; filename=".profile" Content-Type: text/plain PATH=/local/perl/bin:$PATH export PATH --6G+f-- If you set the $DYNAMIC_FILE_UPLOAD variable (exportable) to some TRUE value, then you get back a request object with a subroutine closure as the content attribute. This subroutine will read the content of any files on demand and return it in suitable chunks. This allow you to upload arbitrary big files without using lots of memory. You can even upload infinite files like /dev/audio if you wish; however, if the file is not a plain file, there will be no Content-Length header defined for the request. Not all servers (or server applications) like this. Also, if the file(s) change in size between the time the Content-Length is calculated and the time that the last chunk is delivered, the subroutine will "Croak". The post(...) method of "LWP::UserAgent" exists as a shortcut for $ua->request(POST ...). SEE ALSO
HTTP::Request, LWP::UserAgent COPYRIGHT
Copyright 1997-2004, Gisle Aas This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2012-09-30 HTTP::Request::Common(3)
All times are GMT -4. The time now is 02:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy