Find and analyze variable Strings in a large file.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find and analyze variable Strings in a large file.
# 1  
Old 07-07-2010
Find and analyze variable Strings in a large file.

Hi guys,
I have multiple files (>5000) which I have in a folder. I read every file name and put it in a tmp variable "i" so that i can use it in the following task.

I have a large .txt file (>50 MB) in which I want to find the variable "i" and the lines after this variable, so that I can use the lines after i to find a other string x ONCE! The string x is seperate by

Code:
<div class="mediaSubtitle">TTTTTTTTTTTTTT</div>

and this "TTTTTTTTTTTTTT" should be the new filename.

Hear is a example:

HTML Code:
....1B79CFF0C7CB11DEB1081A950A00210A.flv&amp;loop=true&

amp;test_var=d8e7eb64bc955c7d80fc945497bf3eba&quot; quality=&
quot;high&quot; scale=&quot;exactfit&quot; menu=&quot;false&quot;
 bgcolor=&quot;#FFFFFF&quot; style=&quot;width:32px;
height:32px;&quot; swLiveConnect=&quot;false&quot; type=&
quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;
/object&gt;&lt;div style=&quot;line-height:14px;padding-top:5px;&quot;&
gt;&lt;strong&gt;Dateiname:&lt;/strong&gt; &lt;span title=&quot;asdfad&
quot;&gt;asdfad&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;Media-ID: 
&lt;/strong&gt; 202061&lt;br /&gt;&lt;/div&gt;', 500, false, getBrowser(), 
20, 20);" onmousemove="popup_setMousePosition(event.clientX, 
event.clientY);popup_setPosition();" onmouseout="hidePopup();" /></a> 

                    <div class="mediaSubtitle">TTTTTTTTTTTTT</div>
Have anyone a idea how I get variable string between "<div class="mediaSubtitle">" and "</div>" to rename the files?

Ashitaka007
# 2  
Old 07-09-2010
And what's the name of the file?
1B79CFF0C7CB11DEB1081A950A00210A.flv?
# 3  
Old 07-09-2010
The name of the file is 1B79CFF0C7CB11DEB1081A950A00210A.flv
right.
# 4  
Old 07-09-2010
We need more information in order to locate the file name, could you post a bigger sample of the data file?
# 5  
Old 07-09-2010
ah i got it, i have use the ";" as delimiter and it works, simple cat.

Thx radoulov for your try to help me
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Grep: Retrieve two strings from one file to find them anyone on line in another file

I am having trouble matching *two* strings from one file anywhere in a line of a second file, and could use some help getting this figured out. My preference would be to use grep for this because I would like to take advantage of its -A option. The latter is due to the fact that I would like both... (2 Replies)
Discussion started by: jvoot
2 Replies

2. Shell Programming and Scripting

Can't input large file to variable

I have a file that I'm trying to place into a variable. I've tried the following: DATE=`date +%Y%m%d` filez=$(cat /tmp/Test_$DATE.txt)DATE=`date +%Y%m%d` filez=$(</tmp/Test_$DATE.txt)DATE=`date +%Y%m%d` filez=$(`cat /tmp/Test_$DATE.txt`)None of these lines allows the file to go into the... (3 Replies)
Discussion started by: newbie2010
3 Replies

3. Solaris

How to find multiple strings on different lines in file?

Hello, I have spent considerable amount of time breaking my head on this and reached out here. here is the back ground. OS - Solaris 10 There are two strings '<Orin>sop' and '<Dup>two' which I wanted to look for in a file without the quotes on different lines and ONLY if both strings are... (5 Replies)
Discussion started by: keithTait309875
5 Replies

4. Shell Programming and Scripting

Find position of character in multiple strings in a file

Greetings. I have a file with information like this: AMNDHRKEOEU?AMNDHRKEOEU?AMNDHRKEOEU?AMNDHRKEOEU? AMNDHRKEEU?AMNDHREOEU? AMNDHREU?AHRKEOEU?AMNDHRKEU?AMNDKEOEU? What I need to extract is the position, in every line, of every occurrence of '?' A desired output would be something... (6 Replies)
Discussion started by: Twinklefingers
6 Replies

5. Shell Programming and Scripting

Search for string in a file, extract two another strings and concatenate to a variable

I have a file with <suit:run date="Trump Tue 06/19/2012 11:41 AM EDT" machine="garg-ln" build="19921" level="beta" release="6.1.5" os="Linux"> Need to find word "build" then extract build number, which is 19921 also release number, which is 6.1.5 then concatenate them to one variable as... (6 Replies)
Discussion started by: garg
6 Replies

6. UNIX for Dummies Questions & Answers

Find word in a large file

Hi all I am working on disallowing users to use easy passwords in pam.d setting on RHEL 5.7 and SuSe 11, and I was hoping to add more words into the current cracklib dict, so I use "echo" command to append new words into the file I dont want to add the same words into the dict, I think I... (2 Replies)
Discussion started by: hedkandi
2 Replies

7. UNIX for Advanced & Expert Users

Find and replace txt between two strings in flat file

Hi There... I need to serach and replace strngs in a text file. My file has; books.amazon='Let me read' news.bestseller='xyz' expected output is books.amazon=NONFOUND news.bestseller=NONFOUND Can I first find the text between string1= books.amazon=' and string2= ' (locate the text... (1 Reply)
Discussion started by: Hiano
1 Replies

8. Shell Programming and Scripting

Find line number of bad data in large file

Hi Forum. I was trying to search the following scenario on the forum but was not able to. Let's say that I have a very large file that has some bad data in it (for ex: 0.0015 in the 12th column) and I would like to find the line number and remove that particular line. What's the easiest... (3 Replies)
Discussion started by: pchang
3 Replies

9. UNIX for Advanced & Expert Users

Find common Strings in two large files

Hi , I have a text file in the format DB2: DB2: WB: WB: WB: WB: and a second text file of the format Time=00:00:00.473 Time=00:00:00.436 Time=00:00:00.016 Time=00:00:00.027 Time=00:00:00.471 Time=00:00:00.436 the last string in both the text files is of the... (4 Replies)
Discussion started by: kanthrajgowda
4 Replies

10. Linux

To find multiple strings count in a file

I need to find the line count of multiple strings in a particular file. The strings are as follows: bmgcc bmgccftp bsmsftp bulkftp cctuneftp crbtftp crmpos cso gujhr I am doing manual grep for each of the string to find the line count. The command i am using right now is: grep mark... (3 Replies)
Discussion started by: salaathi
3 Replies
Login or Register to Ask a Question