![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| update base | mleplawy | Shell Programming and Scripting | 6 | 06-02-2008 02:14 PM |
| Getting data into and out of an OpenOffice.org Base database | iBot | UNIX and Linux RSS News | 0 | 04-23-2008 03:50 PM |
| Update NIS+ data | djunerup | SUN Solaris | 0 | 03-26-2008 11:37 AM |
| Using loop reading a file,retrieving data from data base. | Sonu4lov | Shell Programming and Scripting | 1 | 01-19-2007 03:38 AM |
| data base | arunkumar_mca | High Level Programming | 2 | 12-29-2004 06:56 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
data base update
hello everyone I need to update data base in file 1-ID 2-Name 3-ID group 4-ID teacher 5-mark list unique ID is (ID+ID group+ID teacher) we can append 5 th columns (marks list) main base file: Code: Code:
1:John:3:1:4 3 2 2:Mark:1:2:1 3 3:Susan:3:4: input file: Code:
2:Mark:1:2:1 3 5 6 3:Susan:3:4:2 4 3 main base file after update: Code:
1:John:3:1:4 3 2 2:Mark:1:2:1 3 5 6 3:Susan:3:4:2 4 3 I have a problem with add files to array and with compare student ID Code:
awk 'BEGIN {x=0}{z=0}{y=0}
{getline base[x++] < "base" }
{getline input[z++] < "input" }
END
{for (i in base)
for(n in input)
if (base[i]==input[n]) //I now, it's not OK column 1,3,4 must be ==
output[y++]=input[n]
else
output[y++]=base[i]
}
{for (z in output)
print output[z] > "base"}'
|
|
||||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|