Sponsored Content
Top Forums Shell Programming and Scripting Help to join separate lines in a single one from xml file Post 303013618 by Ophiuchus on Saturday 24th of February 2018 01:40:52 PM
Old 02-24-2018
Hi RudiC,

Thanks for your help.

I see your script prints the output desired but when I try it the output is different.

I get this output.
Code:
OS family
 nix pk1
  originally meant to be a
  for programmersorm

Source model
 nix pk2
 closed-source
  Development started in 1969.ly and Illumos)
  last paragraph.

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Separate lines in a single '|' separated line

Hi I have a file with contents like china india france japan italy germany . . . . etc.... I want the output as china|india|france|japan|italy|germany|.|.|. (3 Replies)
Discussion started by: hidnana
3 Replies

2. Shell Programming and Scripting

Join in a single line variable number of lines

Hi all, I have a file with little blocks beginning with a number 761XXXXXX, and 0, 1, 2 or 3 lines below of it beginning with STUS as follow: 761625820 STUS ACTIVE 16778294 STUS NOT ACTIVE 761157389 STUS ACTIVE 16778294 761554921 STUS ACTIVE 16778294 STUS NOT ACTIVE STUS ACTIVE OP... (4 Replies)
Discussion started by: cgkmal
4 Replies

3. Shell Programming and Scripting

Using AWK to separate data from a large XML file into multiple files

I have a 500 MB XML file from a FileMaker database export, it's formatted horribly (no line breaks at all). The node structure is basically <FMPXMLRESULT> <METADATA> <FIELD att="............." id="..."/> </METADATA> <RESULTSET FOUND="1763457"> <ROW att="....." etc="...."> ... (16 Replies)
Discussion started by: JRy
16 Replies

4. Shell Programming and Scripting

Separate lines from text file

I have a text file with lot of rows like.. Action & Adventure|2012: Supernova NR|2009-11-01 00:01:00|2010-05-01 23:59:00|Active|3 Action & Adventure|50 Dead Men Walking|2010-01-05 00:01:00|2010-06-30 23:59:00|Active|3 Action & Adventure|Afterwards|2009-11-26 00:01:00|2010-03-26... (3 Replies)
Discussion started by: ramse8pc
3 Replies

5. UNIX for Dummies Questions & Answers

How to separate a single column file into files of the same size (i.e. number of rows)?

I have a text file with 1,000,000 rows (It is a single column text file of numbers). I would like to separate the text file into 100 files of equal size (i.e. number of rows). The first file will contain the first 10,000 rows, the second row will contain the second 10,000 rows (rows 10,001-20,000)... (2 Replies)
Discussion started by: evelibertine
2 Replies

6. Shell Programming and Scripting

How to add the multiple lines of xml tags before a particular xml tag in a file

Hi All, I'm stuck with adding multiple lines(irrespective of line number) to a file before a particular xml tag. Please help me. <A>testing_Location</A> <value>LA</value> <zone>US</zone> <B>Region</B> <value>Russia</value> <zone>Washington</zone> <C>Country</C>... (0 Replies)
Discussion started by: mjavalkar
0 Replies

7. UNIX for Dummies Questions & Answers

Join lines in a file????

Hello UNIX gurus, I am new to the world of UNIX. Hopefully I am submitting my question at the right forum. Here is my dilemma - I have a file with contents like this - "line1","Hello","World","Today is a wonderful day","yes it is" "line2","Hello","World","Today is a beautiful day","oh... (8 Replies)
Discussion started by: foolishbar
8 Replies

8. UNIX for Dummies Questions & Answers

How to generate one long column by merging two separate two columns in a single file?

Dear all, I have a simple question. I have a file like below (separated by tab): col1 col2 col3 col4 col5 col6 col7 21 66745 rs1234 21 rs5678 23334 0.89 21 66745 rs2334 21 rs9978 23334 0.89 21 66745 ... (4 Replies)
Discussion started by: forevertl
4 Replies

9. Shell Programming and Scripting

Splitting a single xml file into multiple xml files

Hi, I'm having a xml file with multiple xml header. so i want to split the file into multiple files. Sample.xml consists multiple headers so how can we split these multiple headers into multiple files in unix. eg : <?xml version="1.0" encoding="UTF-8"?> <ml:individual... (3 Replies)
Discussion started by: Narendra921631
3 Replies

10. UNIX for Beginners Questions & Answers

Ls to text file on separate lines

hi, I'm trying to print out the contents of a folder into a .txt file. The code I'm trying amongst variations is: ls -1 > filenames.txt but it prints them all on the same line ie. image102.bmpimage103.bmpimage104.bmpimage105.bmpimage106.bmp how can I change this? Please... (2 Replies)
Discussion started by: newbie100
2 Replies
OPENSSL_SEAL(3) 							 1							   OPENSSL_SEAL(3)

openssl_seal - Seal (encrypt) data

SYNOPSIS
int openssl_seal (string $data, string &$sealed_data, array &$env_keys, array $pub_key_ids, [string $method]) DESCRIPTION
openssl_seal(3) seals (encrypts) $data by using RC4 with a randomly generated secret key. The key is encrypted with each of the public keys associated with the identifiers in $pub_key_ids and each encrypted key is returned in $env_keys. This means that one can send sealed data to multiple recipients (provided one has obtained their public keys). Each recipient must receive both the sealed data and the envelope key that was encrypted with the recipient's public key. PARAMETERS
o $data - o $sealed_data - o $env_keys - o $pub_key_ids - RETURN VALUES
Returns the length of the sealed data on success, or FALSE on error. If successful the sealed data is returned in $sealed_data, and the envelope keys in $env_keys. EXAMPLES
Example #1 openssl_seal(3) example <?php // $data is assumed to contain the data to be sealed // fetch public keys for our recipients, and ready them $fp = fopen("/src/openssl-0.9.6/demos/maurice/cert.pem", "r"); $cert = fread($fp, 8192); fclose($fp); $pk1 = openssl_get_publickey($cert); // Repeat for second recipient $fp = fopen("/src/openssl-0.9.6/demos/sign/cert.pem", "r"); $cert = fread($fp, 8192); fclose($fp); $pk2 = openssl_get_publickey($cert); // seal message, only owners of $pk1 and $pk2 can decrypt $sealed with keys // $ekeys[0] and $ekeys[1] respectively. openssl_seal($data, $sealed, $ekeys, array($pk1, $pk2)); // free the keys from memory openssl_free_key($pk1); openssl_free_key($pk2); ?> SEE ALSO
openssl_open(3). PHP Documentation Group OPENSSL_SEAL(3)
All times are GMT -4. The time now is 03:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy