LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how i can genrate LUTs using bash (https://www.linuxquestions.org/questions/linux-newbie-8/how-i-can-genrate-luts-using-bash-4175528071/)

shazo 12-12-2014 07:08 AM

how i can genrate LUTs using bash
 
hello,
i have to make a table of form {1,2,3,4}
{1,2,4,5}
{1,2,3,4}
i have data in difernt files how i will genrate this using bash. your coments will be apriciated.

pan64 12-12-2014 09:47 AM

you need to give us more detailed information about the files containing the input data and how do you want to construct the result.

shazo 12-12-2014 10:01 AM

i have a files having data which is random data like some have data(numbers) in vertical and in some files data(numbers)is in horitontal. these files are atomatically genrated file i have to access it to take data only i dont have to rearange them. my task is "i have to access files to take the data from all files ,lets say 2 files and arange them as a table form like 10 numbers in one line other 10 in next line and so on upto let us say 5 lines.

pan64 12-12-2014 10:04 AM

can you show an example? How should it really work? By the way, have you tried to implement it?

shazo 12-12-2014 10:21 AM

yeah i am tring using single file but i am not getting what i want
here is
#!/bin/bash

for (( i = 1; i <= 14; i++ ))
do

for (( j = 1 ; j <= 11; j++ ))
do
#while
read -r name
#do
echo "{$name,}"

done <"$Files"

echo ""
done


done

grail 12-12-2014 11:13 AM

Firstly, please use [code][/code] tags around your code.

As for the code itself, it makes little to no sense :(

1. You have commented out the start of the while loop, but left in the 'done' that is trying to read from the file

2. You read a value into 'name' variable and echo it straight away ... for what reason?

3. What purpose do the 2 for loops hold? Ignoring the 'done' trying to read from a file, these loops will ask for and print the 'name' variable 154 times ... is this the idea?

4. Lastly, what is a 'LUT'? (pardon my ignorance)


All times are GMT -5. The time now is 06:12 PM.