Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8482461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:50:10+00:00 2026-06-10T19:50:10+00:00

need big help again File1: \\server2\share1,\\serverdfs\dfs\test2 \\server1\anothershare,\\serverdfs\dfs\test1 File2: \\server2\share1,/fs7/server1/share1 \\server1\anothershare,/fs1/serverx/share1 \\server4\newshare,/fs7/server1/share1 Script: @ECHO OFF

  • 0

need big help again

File1:

\\server2\share1,\\serverdfs\dfs\test2
\\server1\anothershare,\\serverdfs\dfs\test1

File2:

\\server2\share1,/fs7/server1/share1
\\server1\anothershare,/fs1/serverx/share1
\\server4\newshare,/fs7/server1/share1

Script:

@ECHO OFF 
DEL file3 2 > nul 
FOR /f "tokens=1*delims=," %%i IN (file1.txt) DO ( 
  FOR /f "tokens=1*delims=," %%a IN (file2.txt) DO ( 
   IF /i "%%i"=="%%a" >>file3 ECHO %%i,%%j,%%b>file3.txt
  ) 
) 

The output is something like this:

\\server2\share1,\\\serverdfs\dfs\test2,/fs7/server1/share1  
\\server1\anothershare,\\\serverdfs\dfs\test1,/fs1/serverx/share1  

The script will search for matches (first field = anything before the comma) between both files (file1.txt & file2.txt).

The problem is for example with \\server4\newshare which is only present on file2.txt.

In this case both of these lines have the same second field:

\\server2\share1,/fs7/server1/share1
\\server4\newshare,/fs7/server1/share1

Can you think of anything in order to show an output similar to this:

\\server2\share1,\\\serverdfs\dfs\test2,/fs7/server1/share1  
\\server1\anothershare,\\\serverdfs\dfs\test1,/fs1/serverx/share1  

only_at_file2.txt, \\server4\newshare,/fs7/server1/share1 same path as \\server2\share1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:50:12+00:00Added an answer on June 10, 2026 at 7:50 pm

    Run like:

    awk -f script.awk file1.txt file2.txt
    

    Contents of script.awk:

    BEGIN {
       FS=OFS=","
    }
    
    FNR==NR {
       array[$1]=$2
       next
    }
    
    {
       if ($1 in array) { 
          print $1, "\\"array[$1], $2
       }
    
       else {
          if ($2 in values) {
             print "only_at_" FILENAME ", " $0 " same path as " values[$2]
          }
          else {
             print "only_at_" FILENAME ", " $0 " no path found"
          }
       }
       values[$2]=$1
    }
    

    Results:

    \\server2\share1,\\\serverdfs\dfs\test2,/fs7/server1/share1
    \\server1\anothershare,\\\serverdfs\dfs\test1,/fs1/serverx/share1
    only_at_file2.txt, \\server4\newshare,/fs7/server1/share1 same path as \\server2\share1
    

    If there are duplicate paths, this will show the last path found in file2.txt (i.e. values[$2]=$1 will override previous paths). For example, if now another server with a path of /fs7/server1/share1 is found in file2.txt, the output server will be \\server4\newshare

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here i am again :( got big problem hiks ... need HELP !!! i
I need help in parsing big Json file: {status:{code:200,text:OK},content:[{proposalId:12536,providerId:1,supervisorName:null,supervisorEmail:lolbroek_13@hotmail.com,hostInstitution:qsd,hostCountry:qsd,hostCity:QSD,hostTypeId:1,title:qsd,status:available,numberStudents:null,description:qsd,categoryId:34,startDate:null,endDate:null,submitDate:null,expectedWorkload:null,purpose:null,workOrganisationId:1,function:null,audienceId:1,preConditions:,certificationGranted:null,deliverables:null,expenses:null,revenue:null,vacancies:null,uploadImg:http:\/\/193.136.60.238\/\/MUTW2012\/core\/img\/internship.png}, {proposalId:12537,providerId:1,supervisorName:null,supervisorEmail:lolbroek_13@hotmail.com,hostInstitution:qsd,hostCountry:qsd,hostCity:QSD,hostTypeId:1,title:qsd,status:available,numberStudents:null,description:qsd,categoryId:34,startDate:null,endDate:null,submitDate:null,expectedWorkload:null,purpose:null,workOrganisationId:1,function:null,audienceId:1,preConditions:,certificationGranted:null,deliverables:null,expenses:null,revenue:null,vacancies:null,uploadImg:http:\/\/193.136.60.238\/\/MUTW2012\/core\/img\/internship.png}, {proposalId:12538,providerId:1,supervisorName:null,supervisorEmail:lolbroek_13@hotmail.com,hostInstitution:qsd,hostCountry:qsd,hostCity:QSD,hostTypeId:1,title:qsd,status:available,numberStudents:null,description:qsd,categoryId:34,startDate:null,endDate:null,submitDate:null,expectedWorkload:null,purpose:null,workOrganisationId:1,function:null,audienceId:1,preConditions:,certificationGranted:null,deliverables:null,expenses:null,revenue:null,vacancies:null,uploadImg:http:\/\/193.136.60.238\/\/MUTW2012\/core\/img\/internship.png}, {proposalId:12539,providerId:1,supervisorName:null,supervisorEmail:lolbroek_13@hotmail.com,hostInstitution:qsd,hostCountry:qsd,hostCity:QSD,hostTypeId:1,title:qsd,status:available,numberStudents:null,description:qsd,categoryId:34,startDate:null,endDate:null,submitDate:null,expectedWorkload:null,purpose:null,workOrganisationId:1,function:null,audienceId:1,preConditions:,certificationGranted:null,deliverables:null,expenses:null,revenue:null,vacancies:null,uploadImg:http:\/\/193.136.60.238\/\/MUTW2012\/core\/img\/internship.png}, ................[etc] I
I need help working with very big numbers. According to Windows calc, the exponent
I need big help, please check out this code: import.math dose =20.0 a =
I need big help from you,I want to upload image using amazon s3 web
I need to write some ruby script which will help me with big image
I need a little help about the zoomify. I want to display big images,
I need a big null array in C as a global. Is there any
We need to think big and our applications need to scale in order to
For a new project I need to load big XML files (200MB+) to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.