INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Match raws with Awk to make an output file

Match raws with Awk to make an output file

(OP)
HI guys! I just discovered this useful forum and i'm wondering if you can help me with my issue..

Below what I want, I have 3 columns, and I would like to distribute raws on first colum with the other 2 colums

http://www.url_from17.com http://www.url_to17.com anchor_text17
http://www.url_from18.com http://www.url_to18.com anchor_text18
http://www.url_from19.com http://www.url_to19.com anchor_text19
http://www.url_from20.com http://www.url_to20.com anchor_text20
http://www.url_from21.com http://www.url_to21.com anchor_text21
http://www.url_from22.com http://www.url_to22.com anchor_text22
http://www.url_from23.com http://www.url_to23.com anchor_text23
http://www.url_from24.com http://www.url_to24.com anchor_text24
http://www.url_from25.com http://www.url_to25.com anchor_text25
http://www.url_from26.com http://www.url_to26.com anchor_text26
http://www.url_from27.com http://www.url_to27.com anchor_text27
http://www.url_from28.com http://www.url_to28.com anchor_text28
http://www.url_from29.com http://www.url_to29.com anchor_text29

The result should be something like that, I want to use 4 URL and their respective anchor text (url_to) for 1 url_from , the outputfile should be like that:

http://www.url_from17.com http://www.url_to17.com anchor_text17
http://www.url_from17.com http://www.url_to18.com anchor_text18
http://www.url_from17.com http://www.url_to19.com anchor_text19
http://www.url_from17.com http://www.url_to20.com anchor_text20
http://www.url_from18.com http://www.url_to21.com anchor_text21
http://www.url_from18.com http://www.url_to22.com anchor_text22
http://www.url_from18.com http://www.url_to23.com anchor_text23
http://www.url_from18.com http://www.url_to24.com anchor_text24
....

Your help will be very useful guys! Than you in advance


RE: Match raws with Awk to make an output file

Quote:

I would like to distribute raws

raws ??? Should that be rows?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Match raws with Awk to make an output file

Hi

stingz75, better specify what is the exact input data. Just a number interval 17..20, or a list of 4 distinct URLs, or something else ?

Feherke.
feherke.ga

RE: Match raws with Awk to make an output file

(OP)
Oh my bad, you're right.. I meant raws.

It could be flat file with columns usings tabs (\t) for example.
It's not intervals it's all about Urls, links and anchortexts

The first column are the pages (or Urls) which will contains my links (links are on the second column) and their respective anchortext

So I want to attach 4 links and 4 anchortext (randomly) for each URL present on the first column.

And the final output file should be like this for my treatment:
E.g:
http://www.tek-tips.com http://www.mylink1.com Anchortext1
http://www.tek-tips.com http://www.mylink2.com Anchortext2
http://www.tek-tips.com http://www.mylink3.com Anchortext3
http://www.tek-tips.com http://www.mylink4.com Anchortext4
http://www.tek-tips.com/page1 http://www.mylink5.com Anchortext5
http://www.tek-tips.com/page2 http://www.mylink6.com Anchortext6
http://www.tek-tips.com/page3 http://www.mylink7.com Anchortext7
http://www.tek-tips.com/page4 http://www.mylink8.com Anchortext8
etc
etc

I hope it's more clear for you.
Thx

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close