Write Shell/Bash Script To Parse Files

Suoritettu Julkaistu 7 vuotta sitten Maksettu toimituksen yhteydessä
Suoritettu Maksettu toimituksen yhteydessä

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.

Shell Script

Projektin tunnus: #10295727

Tietoa projektista

14 ehdotusta Etäprojekti Aktiivinen 7 vuotta sitten

Myönnetty käyttäjälle:

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 Lisää

$55 USD 1 päivässä
(1 arvostelu)
1.5

14 freelanceria on tarjonnut keskimäärin $87 tähän työhön

retrospock

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

$250 USD 2 päivässä
(4 arvostelua)
3.3
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 Lisää

$60 USD 2 päivässä
(0 arvostelua)
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 5 päivässä
(0 arvostelua)
0.0
madissa

A proposal has not yet been provided

$95 USD 3 päivässä
(0 arvostelua)
0.0
sagar2448

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

$50 USD 0 päivässä
(0 arvostelua)
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 Lisää

$111 USD 3 päivässä
(0 arvostelua)
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: Lisää

$45 USD 1 päivässä
(0 arvostelua)
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 2 päivässä
(0 arvostelua)
0.0