Lengkap

Write Shell/Bash Script To Parse Files

I need a bash/shell script that will parse a folder of files and place those files into their own folders.

It must only place specific files into those folders. There may be alot of other junk that we will want to not process.

For example, I want to make sure I can organize all the webstar files into separate directors. I have a folder with the following:

[login to view URL]

[login to view URL]

[login to view URL]

[login to view URL]

[login to view URL]

[login to view URL]

[login to view URL]

[login to view URL]

[login to view URL]

temp_folder

-> [login to view URL]

the script should process this directory and organize accordingly. Note that you would need to recursively process for the pattern as they might be folders in addition to files. Note the temp_folder with the "[login to view URL]" file. Recursive searching should be optional. There might be cases we do not want to go deeper.

webstar_canyon

-> [login to view URL]

-> [login to view URL]

-> [login to view URL]

> [login to view URL]

webstar_river

-> [login to view URL]

-> [login to view URL]

webstar_ocean

-> [login to view URL]

The output path for the above should be configurable from the directory the files reside in.

The input path where the source files reside must be configurable as well.

File extensions will vary. So think go it like an include definition (include=.csv,.txt). For example, if there was a txt file in addition to the cvs, we would want to process that as well.

webstar_ocean

-> [login to view URL]

-> [login to view URL]

Also, take note of the [login to view URL] example. Sometimes the pattern of interest "webstar_canyon" is in the file mask, just not the same location. So the script might need a dictionary or included set of patterns to look for. In this case it was files with webstar_ocean, webstar_river, webstar_canyon in the file mask with .csv and .txt extensions.

Make sure you are including tests to make sure that your processing worked according to the defined rules. You don't want the wrong files ending up in the wrong directories.

This should be straight forward, I just don't have the time to do it right now. Any questions, reach out.

Please note, the "webstar" was for example. The string will vary. It won't always be webstar_*. At run time I will be including a specific config file outside of this request Im asking your to write. That config file would be tightly coupled to the specific process being undertaken. I have a separate script called job.sh. In that script a config (or job) is passed. So "job.sh webstar". This would tell job.sh to load the "webstar" specific config file. In that file would be the run time details (i.e. strings, extensions, directories) that would be used by this process.

Kemahiran: Skrip Kekerang

Lihat lagi: think recursively, recursively, pattern searching, bash directory script

Tentang Majikan:
( 13 ulasan ) Winchester, United States

ID Projek: #10295727

Dianugerahkan kepada:

yzupwork

Hi, I have a few questions? could you answering? 1, the script need to parse just "webstar" files only? I can use some utility commands to parsing the files, and move it to the according directory. [login to view URL] maybe Lagi

$55 USD dalam sehari
(1 Ulasan)
1.5

14 pekerja bebas membida secara purata $87 untuk pekerjaan ini

odessky

Hello! My name is Andrey. I'm from Odessa, Ukraine. I have right skills and great experience for begin working on your project just right now! You may show good reviews at my profile https://www.freelancer.com/u/odessk Lagi

$100 USD dalam 3 hari
(9 Ulasan)
4.8
retrospock

I can help you with this script. Please feel free to message me and we can discuss it further. Thanks

$250 USD dalam 2 hari
(4 Ulasan)
3.3
midtask

Hello. I thought your project was interesting so I started writing a script. I'm not sure what your plan is for configuring alternate input and output directories. Cost to bid is already out there so I might as w Lagi

$50 USD dalam 0 hari
(0 Ulasan)
0.0
loitd

I am a senior python developer and i am also a mentor for several python classes. I have done with traversing files and directories and build many apps to deal with files and folder. Its basic task but need to be tak Lagi

$60 USD dalam 2 hari
(0 Ulasan)
0.0
miljkovicivann

I use linux for few years now, and am familiar with bash scripting. I can deliver this for you. contact me if you are looking for fast solution, Best regards

$111 USD dalam 5 hari
(0 Ulasan)
0.0
redeserv

I'm a professional with 21 years of experience of Information Technology, starting my career with Desktop systems Developer, today Infrastructure and Security Information Specialist with a big knowledge of Virtual Envi Lagi

$55 USD dalam 2 hari
(0 Ulasan)
0.0
supergopi

Hi, I could take up this task and do a bash script. I can even write a python script for the same task if you wish. Let me know what you wish. Lets see If I understand correctly: I am going to write a script call Lagi

$49 USD dalam sehari
(0 Ulasan)
0.0
madissa

A proposal has not yet been provided

$95 USD dalam 3 hari
(0 Ulasan)
0.0
sagar2448

Hands on experience on unix shell scripting, Will provide fully functional script, within time....................

$50 USD dalam 0 hari
(0 Ulasan)
0.0
hasanucak

hi. i think,i can do via regex in shellscript for example regex = "([^/]+)webstar_canyon([^/]+).(txt|cvs)" if [[ $ffname =~ $regex ]]; then bname=basename $ffname Lagi

$111 USD dalam 3 hari
(0 Ulasan)
0.0
kosala5

Hi, I'm a UNIX expert based out of Sri Lanka, and I would gladly write your script for the mentioned bid. I believe this script should not take more than couple hours. We can do the script in two possible ways: Lagi

$45 USD dalam sehari
(0 Ulasan)
0.0
$155 USD dalam sehari
(0 Ulasan)
0.0
romanr2

#!/bin/sh -ex echo "Shell scripting is my nature!" echo "For a feedback I'll make it almost for free!"

$30 USD dalam 2 hari
(0 Ulasan)
0.0