Sponsored Content
Top Forums Shell Programming and Scripting how read specific line in a file and write it in a new text file? Post 302598640 by vel4ever on Wednesday 15th of February 2012 04:09:27 AM
Old 02-15-2012
how read specific line in a file and write it in a new text file?

I have list of files in a directory 'dir'. Each file is of type HTML. I need to read each file and get the string which starts with 'http' and write them in a new text file. How can i do this shell scripting?

file1.html
Code:
<head>
<url>http://www.google.com</url>
</head>

file2.html
Code:
<head>
<url>http://www.yahoo.com</url>
</head>

text.txt
Code:
http://www.google.com
http://www.yahoo.com

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read specific text from a log file

Hi guys I need to retrieve the values in BOLD that I have mentioned in the below log file. I want to store those values in a variable, preferably the same name as the column name in the log file. if you paste the below mentioned log file in a notepad and remove the word wrap.. u will get a... (4 Replies)
Discussion started by: ragha81
4 Replies

2. Shell Programming and Scripting

read space filled file and replace text at specific position

Hi I have a spaced filled file having records like below: What I want is to read line having RT3 at position 17-19 then go to position 2651 check the 18 characters (might be space filled till 18 characters). This position should have a... (6 Replies)
Discussion started by: COD
6 Replies

3. Shell Programming and Scripting

Adding specific text and spaces to each line in a text file

Hi, I wanted to add specific text to each row in a text file containing three rows. Example: 0 8 7 6 5 5 7 8 9 0 7 9 7 8 9 0 1 2 And I want to add a 21 at the beginning of the first row, and blank spaces at the beginning of the second two rows. To get this: 21 0 8 7 6 5 5 7 8... (4 Replies)
Discussion started by: hertingm
4 Replies

4. Shell Programming and Scripting

Read Write byte range/chunk of data from specific location in file

I am new to Unix so will really appreciate if someone can guide me on this. What I want to do is: Step1: Read binary file - pick first 2 bytes, convert from hex to decimal. Read the next 3 bytes as well. 2 bytes will specify the number of bytes 'n' that I want to read and write... (1 Reply)
Discussion started by: Kbenipel
1 Replies

5. Shell Programming and Scripting

Read file from nth line to specific character

Hi, I want to read the file from nth line (where n is an integer) to until I encounter @ char. Can any one please help me how to do this? Thanks. (3 Replies)
Discussion started by: laalesh
3 Replies

6. Shell Programming and Scripting

write specific line number in file

dear all, i need your advice i have sample script like this: testing.sh for i in {1..10} do echo testing $i done but i forgot create "#!/bin/bash" in above "for" so i want output will like this testing.sh #!/bin/bash for i in {1..10} do echo testing $i done (2 Replies)
Discussion started by: zvtral
2 Replies

7. Shell Programming and Scripting

How to read particular line in file from specific column?

Hi...friends.... I want to create inventory...information for that I need to read some specific row say 2nd row from 1st 3 column and and write data with particular file used, I have some more column also but I need only 3 column data of first entry after header I attached sample file..those... (12 Replies)
Discussion started by: nex_asp
12 Replies

8. Shell Programming and Scripting

To read specific line from a file

Hi, I have a ldif file like below: version: 1 dn: cn=Test Group,ou=Applications,dc=xyz,dc=com objectClass: groupOfUniqueNames objectClass: top cn: Test Group uniqueMember: uid=abc,ou=People,o=xyz,o=Corporate,dc=xyz,dc=com dn: cn=Test Sub Group,cn=Test... (4 Replies)
Discussion started by: saurau
4 Replies

9. Shell Programming and Scripting

Extract specific line in an html file starting and ending with specific pattern to a text file

Hi This is my first post and I'm just a beginner. So please be nice to me. I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file? I have tried sed -n 241,241p... (13 Replies)
Discussion started by: dejavo
13 Replies

10. Shell Programming and Scripting

How to read all data after a specific string from a text file ?

Hi, I have a file(input.txt) and trying to format as output.txt. See the attached file format. Note: This is a windows file (DOS format) and the commands are also going to execute on windows. Basically I am trying to capture all the data in between Local Group Memberships and Global Group... (10 Replies)
Discussion started by: Monoj2014
10 Replies
Image::ExifTool::QuickTime(3)				User Contributed Perl Documentation			     Image::ExifTool::QuickTime(3)

NAME
Image::ExifTool::QuickTime - Read QuickTime and MP4 meta information SYNOPSIS
This module is used by Image::ExifTool DESCRIPTION
This module contains routines required by Image::ExifTool to extract information from QuickTime and MP4 video, and M4A audio files. AUTHOR
Copyright 2003-2010, Phil Harvey (phil at owl.phy.queensu.ca) This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. REFERENCES
<http://developer.apple.com/documentation/QuickTime/> http://search.cpan.org/dist/MP4-Info-1.04/ <http://search.cpan.org/dist/MP4-Info-1.04/> http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt <http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt> <http://wiki.multimedia.cx/index.php?title=Apple_QuickTime> http://atomicparsley.sourceforge.net/mpeg-4files.html <http://atomicparsley.sourceforge.net/mpeg-4files.html> <http://wiki.multimedia.cx/index.php?title=QuickTime_container> <http://code.google.com/p/mp4v2/wiki/iTunesMetadata> <http://www.canieti.com.mx/assets/files/1011/IEC_100_1384_DC.pdf> SEE ALSO
"QuickTime Tags" in Image::ExifTool::TagNames, Image::ExifTool(3pm) perl v5.12.1 2010-03-09 Image::ExifTool::QuickTime(3)
All times are GMT -4. The time now is 04:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy