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 9247601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:46:14+00:00 2026-06-18T09:46:14+00:00

the file have many lines, each lines contain int folder-name file-path file-path file-path eg.

  • 0

the file have many lines, each lines contain

int folder-name file-path file-path file-path

eg.

1001    AS35_59328      RICwdsRSYHSD11-2-IPAAPEK-93     /ifshk5/BC_IP/PROJECT/T1
1073/T11073_RICekkR/Fq/AS35_59328/111220_I631_FCC0E5EACXX_L4_RICwdsRSYHSD11-2-IP
AAPEK-93_1.fq.gz        /ifshk5/BC_IP/PROJECT/T11073/T11073_RICekkR/Fq/AS35_5932
8/111220_I631_FCC0E5EACXX_L4_RICwdsRSYHSD11-2-IPAAPEK-93_2.fq.gz  
/ifshk5/BC_IP/PROJECT/T11073/T11073_RICekkR/Fq/AS35_5932
8/111220_I631_FCC0E5EACXX_L4_RICwdsRSYHSD11-2-IPAAPEK-9322121_2.fq.gz  

so how can i get the folder name( AS35_59328 ) and create folder if it is not created.

get the line second section AS35_59328, if the AS35_59328 has already exist, put all files in the line into folder, else create AS35_59328 folder then put files into

  • 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-18T09:46:15+00:00Added an answer on June 18, 2026 at 9:46 am

    Another purely shell solution:

    while read line; do
      set $line
      key=$1; shift
      dir=$1; shift
      test -d $dir || mkdir $dir
      mv $@ $dir
    done < myfile.txt
    
        bll-laptop:bll$ cat t.sh
        #!/bin/bash
    
        cat > myfile.txt << _HERE_
        1001 d1 a b c
        1002 d2 d e f
        1003 d3 g h i
        _HERE_
    
        touch a b c d e f g h i
        rm -rf d1 d2 d2 > /dev/null 2>&1
        mkdir d1
    
        while read line; do
          set $line
          key=$1; shift
          dir=$1; shift
          test -d $dir || mkdir $dir
          mv $@ $dir
        done < myfile.txt
    
        ls -R
    
        bll-laptop:bll$ ./t.sh
        .:
        d1  d2  d3  myfile.txt  t.sh
    
        ./d1:
        a  b  c
    
        ./d2:
        d  e  f
    
        ./d3:
        g  h  i
        bll-laptop:bll$
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a test file that has many lines, each line looks something like:
I have a plain text file with many lines. Each line contains 5 words
I have a large file which contains 400000 lines, each line contains many number
I have a file with many lines in it. One of them look like
I have a file like this (tab delimited), but many lines 1314 0 0
I have a file that is similar to this: <many lines of stuff> SUMMARY:
I have a file containing many lines of text, and I want to match
I have a file called !input.txt containing multiple lines, each line is a random
I have a txt file with 16 lines of integers. Each line contains 5
Im reading csv files into a list. since each file contains many lines and

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.